<!doctype html>


<html>
<head>
  <link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
  <title>LinkedMap (Closure Library API Documentation - JavaScript)</title>
  <link rel="stylesheet" href="static/css/base.css">
  <link rel="stylesheet" href="static/css/doc.css">
  <link rel="stylesheet" href="static/css/sidetree.css">
  <link rel="stylesheet" href="static/css/prettify.css">

  <script>
     var _staticFilePath = "static/";
     var _typeTreeName = "goog";
     var _fileTreeName = "Source";
  </script>

  <script src="static/js/doc.js">
  </script>

  <script type="text/javascript" src="//www.google.com/jsapi"></script>
  <script type="text/javascript">
     google.load("visualization", "1", {packages:["orgchart"]});
     var _loadingVisualizations = true;
  </script>

  <meta charset="utf8">
</head>

<body onload="grokdoc.onLoad();">

<div id="header">
  <div class="g-section g-tpl-50-50 g-split">
    <div class="g-unit g-first">
      <a id="logo" href="index.html">Closure Library API Documentation</a>
    </div>

    <div class="g-unit">
      <div class="g-c">
        <strong>Go to class or file:</strong>
        <input type="text" id="ac">
      </div>
    </div>
  </div>
</div>





<div class="colmask rightmenu">
<div class="colleft">
    <div class="col1">
      <!-- Column 1 start -->

<div id="title">
        <span class="fn">structs.LinkedMap</span>
        <span>Extends</span>
        <span class="fn-name">
          
        </span>
</div>

<div class="g-section g-tpl-75-25">
  <div class="g-unit g-first" id="description">
    Class for a LinkedMap datastructure, which combines O(1) map access for
key/value pairs with a linked list for a consistent iteration order. Sample
usage:

<pre class="lang-js prettyprint">
var m = new LinkedMap();
m.set('param1', 'A');
m.set('param2', 'B');
m.set('param3', 'C');
alert(m.getKeys()); // param1, param2, param3

var c = new LinkedMap(5, true);
for (var i = 0; i &lt; 10; i++) {
  c.set('entry' + i, false);
}
alert(c.getKeys()); // entry9, entry8, entry7, entry6, entry5

c.set('entry5', true);
c.set('entry1', false);
alert(c.getKeys()); // entry1, entry5, entry9, entry8, entry7
</pre>
  </div>


        <div class="g-unit" id="useful-links">
          <div class="title">Useful links</div>
          <ol>
            <li><a href="local_closure_goog_structs_linkedmap.js.source.html"><span class='source-code-link'>Source Code</span></a></li>
            <li><a href="http://code.google.com/p/closure-library/source/browse/local/closure/goog/structs/linkedmap.js">Git</a></li>
          </ol>
        </div>
</div>






<h2 class="g-first">Inheritance</h2>
<div class='gviz-org-chart-container goog-inline-block'>
<table class='gviz-org-chart' style='display:none'>
  <tr><td>goog.structs.LinkedMap</td><td></td></tr>
</table>
</div>
<div class='gviz-org-chart-container goog-inline-block'>
<table class='gviz-org-chart' style='display:none'>
</table>
</div>




  <h2>Constructor</h2>
      <div class="fn-constructor">
    goog.structs.LinkedMap(<span><span class="arg">opt_maxCount</span>,&nbsp;<span class="arg">opt_cache</span></span>)
  </div>

   <h3>Parameters</h3>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">opt_maxCount</span>
        : <span class="type">number=</span>
        <div class="entryOverview">The maximum number of objects to store in the
    LinkedMap. If unspecified or 0, there is no maximum.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_cache</span>
        : <span class="type">boolean=</span>
        <div class="entryOverview">When set, the LinkedMap stores items in order
    from most recently used to least recently used, instead of insertion
    order.</div>
     </td>
   </tr>
  </table>


<h2>Instance Methods</h2>


  <div class="legend">
        <span class="key publickey"></span><span>Public</span>
        <span class="key protectedkey"></span><span>Protected</span>
        <span class="key privatekey"></span><span>Private</span>
  </div>







<div>
       <div class="desc">
         Defined in
         <span class="fn-name">
            <a href="class_goog_structs_LinkedMap.html">
              goog.structs.LinkedMap
            </a>
         </span>
       </div>






<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.structs.LinkedMap.prototype.clear"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">clear<span class="args">()</span>
        </span>
      </div>


     <div class="entryOverview">
       Removes all entries in this object.

     </div>

   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_linkedmap.js.source.html#line298">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.structs.LinkedMap.prototype.contains"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">contains<span class="args">(<span class="arg">value</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       Tests whether a provided value is currently in the LinkedMap. This does not
affect item ordering in cache-style LinkedMaps.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">value</span>
        : <span class="type">VALUE</span>
        <div class="entryOverview">The value to check for.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            Whether the value is in the LinkedMap.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_linkedmap.js.source.html#line277">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.structs.LinkedMap.prototype.containsKey"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">containsKey<span class="args">(<span class="arg">key</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       Tests whether a provided key is currently in the LinkedMap. This does not
affect item ordering in cache-style LinkedMaps.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">key</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">The key to check for.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            Whether the key is in the LinkedMap.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_linkedmap.js.source.html#line290">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.structs.LinkedMap.prototype.every"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">every<span class="args">(<span class="arg">f</span>,&nbsp;<span class="arg">opt_obj</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       Calls a function on each item in the LinkedMap and returns true only if every
function call returns a true-like value.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">f</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function">Function</a></span>
        <div class="entryOverview">The function to call for each item. The function takes
    three arguments: the value, the key, and the Cache, and returns a
    boolean.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_obj</span>
        : <span class="type">Object=</span>
        <div class="entryOverview">The object context to use as "this" for the
    function.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            Whether f evaluates to true for every item in the Cache.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_linkedmap.js.source.html#line375">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>






  <td>
    <a name="goog.structs.LinkedMap.prototype.findAndMoveToTop_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">findAndMoveToTop_<span class="args">(<span class="arg">key</span>)</span>
        </span>
        &#8658; <span class="type"><a href="class_goog_structs_LinkedMap_Node_.html">goog.structs.LinkedMap.Node_</a></span>
      </div>


     <div class="entryOverview">
       Finds a node and updates it to be the most recently used.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">key</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">The key of the node.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="class_goog_structs_LinkedMap_Node_.html">goog.structs.LinkedMap.Node_</a></span>&nbsp;
            The node or null if not found.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_linkedmap.js.source.html#line95">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.structs.LinkedMap.prototype.forEach"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">forEach<span class="args">(<span class="arg">f</span>,&nbsp;<span class="arg">opt_obj</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Calls a function on each item in the LinkedMap.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">f</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function">Function</a></span>
        <div class="entryOverview">The function to call for each item. The function takes
    three arguments: the value, the key, and the LinkedMap.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_obj</span>
        : <span class="type">Object=</span>
        <div class="entryOverview">The object context to use as "this" for the
    function.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_linkedmap.js.source.html#line312">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.structs.LinkedMap.prototype.get"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">get<span class="args">(<span class="arg">key</span>,&nbsp;<span class="arg">opt_val</span>)</span>
        </span>
        &#8658; <span class="type">VALUE</span>
      </div>


     <div class="entryOverview">
       Retrieves the value for a given key. If this is a caching LinkedMap, the
entry will become the most recently used.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">key</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">The key to retrieve the value for.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_val</span>
        : <span class="type">VALUE=</span>
        <div class="entryOverview">A default value that will be returned if the key is
    not found, defaults to undefined.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type">VALUE</span>&nbsp;
            The retrieved value.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_linkedmap.js.source.html#line115">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.structs.LinkedMap.prototype.getCount"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">getCount<span class="args">()</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
      </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&nbsp;
            The number of items currently in the LinkedMap.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_linkedmap.js.source.html#line223">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.structs.LinkedMap.prototype.getKeys"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">getKeys<span class="args">()</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>&gt;
      </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>&gt;&nbsp;
            The list of the keys in the appropriate order for
    this LinkedMap.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_linkedmap.js.source.html#line253">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.structs.LinkedMap.prototype.getValues"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">getValues<span class="args">()</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type">VALUE</span>&gt;
      </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type">VALUE</span>&gt;&nbsp;
            The list of the values in the appropriate order for
    this LinkedMap.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_linkedmap.js.source.html#line264">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>






  <td>
    <a name="goog.structs.LinkedMap.prototype.insert_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">insert_<span class="args">(<span class="arg">node</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Appends a node to the list. LinkedMap in cache mode adds new nodes to
the head of the list, otherwise they are appended to the tail. If there is a
maximum size, the list will be truncated if necessary.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">node</span>
        : <span class="type"><a href="class_goog_structs_LinkedMap_Node_.html">goog.structs.LinkedMap.Node_</a></span>
        <div class="entryOverview">The item to insert.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_linkedmap.js.source.html#line393">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.structs.LinkedMap.prototype.isEmpty"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">isEmpty<span class="args">()</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            True if the cache is empty, false if it contains any items.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_linkedmap.js.source.html#line231">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.structs.LinkedMap.prototype.map"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">map<span class="args">(<span class="arg">f</span>,&nbsp;<span class="arg">opt_obj</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type">VALUE</span>&gt;
      </div>


     <div class="entryOverview">
       Calls a function on each item in the LinkedMap and returns the results of
those calls in an array.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">f</span>
        : <span>!</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function">Function</a></span>
        <div class="entryOverview">The function to call for each item. The function takes
    three arguments: the value, the key, and the LinkedMap.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_obj</span>
        : <span class="type">Object=</span>
        <div class="entryOverview">The object context to use as "this" for the
    function.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type">VALUE</span>&gt;&nbsp;
            The results of the function calls for each item in
    the LinkedMap.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_linkedmap.js.source.html#line331">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.structs.LinkedMap.prototype.peek"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">peek<span class="args">()</span>
        </span>
        &#8658; <span class="type">VALUE</span>
      </div>


     <div class="entryOverview">
       Returns the value of the first node without making any modifications.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type">VALUE</span>&nbsp;
            The value of the first node or undefined if the map is empty.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_linkedmap.js.source.html#line158">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.structs.LinkedMap.prototype.peekLast"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">peekLast<span class="args">()</span>
        </span>
        &#8658; <span class="type">VALUE</span>
      </div>


     <div class="entryOverview">
       Returns the value of the last node without making any modifications.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type">VALUE</span>&nbsp;
            The value of the last node or undefined if the map is empty.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_linkedmap.js.source.html#line167">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.structs.LinkedMap.prototype.peekValue"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">peekValue<span class="args">(<span class="arg">key</span>,&nbsp;<span class="arg">opt_val</span>)</span>
        </span>
        &#8658; <span class="type">VALUE</span>
      </div>


     <div class="entryOverview">
       Retrieves the value for a given key without updating the entry to be the
most recently used.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">key</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">The key to retrieve the value for.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_val</span>
        : <span class="type">VALUE=</span>
        <div class="entryOverview">A default value that will be returned if the key is
    not found.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type">VALUE</span>&nbsp;
            The retrieved value.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_linkedmap.js.source.html#line129">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.structs.LinkedMap.prototype.pop"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">pop<span class="args">()</span>
        </span>
        &#8658; <span class="type">VALUE</span>
      </div>


     <div class="entryOverview">
       Removes the last node from the list and returns its value.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type">VALUE</span>&nbsp;
            The value of the popped node, or undefined if the map was
    empty.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_linkedmap.js.source.html#line187">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>






  <td>
    <a name="goog.structs.LinkedMap.prototype.popNode_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">popNode_<span class="args">(<span class="arg">node</span>)</span>
        </span>
        &#8658; <span class="type">VALUE</span>
      </div>


     <div class="entryOverview">
       Removes the node from the LinkedMap if it is not the head, and returns
the node's value.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">node</span>
        : <span>!</span><span class="type"><a href="class_goog_structs_LinkedMap_Node_.html">goog.structs.LinkedMap.Node_</a></span>
        <div class="entryOverview">The item to remove.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type">VALUE</span>&nbsp;
            The value of the popped node.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_linkedmap.js.source.html#line435">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.structs.LinkedMap.prototype.remove"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">remove<span class="args">(<span class="arg">key</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       Removes a value from the LinkedMap based on its key.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">key</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">The key to remove.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            True if the entry was removed, false if the key was not
    found.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_linkedmap.js.source.html#line198">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry protected">
       <td class="access"></td>






  <td>
    <a name="goog.structs.LinkedMap.prototype.removeNode"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">removeNode<span class="args">(<span class="arg">node</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Removes a node from the <code> LinkedMap</code>. It can be overridden to do
further cleanup such as disposing of the node value.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">node</span>
        : <span>!</span><span class="type"><a href="class_goog_structs_LinkedMap_Node_.html">goog.structs.LinkedMap.Node_</a></span>
        <div class="entryOverview">The node to remove.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_linkedmap.js.source.html#line214">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.structs.LinkedMap.prototype.set"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">set<span class="args">(<span class="arg">key</span>,&nbsp;<span class="arg">value</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Sets a value for a given key. If this is a caching LinkedMap, this entry
will become the most recently used.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">key</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">The key to retrieve the value for.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">value</span>
        : <span class="type">VALUE</span>
        <div class="entryOverview">A default value that will be returned if the key is
    not found.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_linkedmap.js.source.html#line142">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.structs.LinkedMap.prototype.setMaxCount"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">setMaxCount<span class="args">(<span class="arg">maxCount</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Sets the maximum number of entries allowed in this object, truncating any
excess objects if necessary.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">maxCount</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">The new maximum number of entries to allow.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_linkedmap.js.source.html#line241">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.structs.LinkedMap.prototype.shift"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">shift<span class="args">()</span>
        </span>
        &#8658; <span class="type">VALUE</span>
      </div>


     <div class="entryOverview">
       Removes the first node from the list and returns its value.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type">VALUE</span>&nbsp;
            The value of the popped node, or undefined if the map was
    empty.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_linkedmap.js.source.html#line177">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.structs.LinkedMap.prototype.some"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">some<span class="args">(<span class="arg">f</span>,&nbsp;<span class="arg">opt_obj</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       Calls a function on each item in the LinkedMap and returns true if any of
those function calls returns a true-like value.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">f</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function">Function</a></span>
        <div class="entryOverview">The function to call for each item. The function takes
    three arguments: the value, the key, and the LinkedMap, and returns a
    boolean.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_obj</span>
        : <span class="type">Object=</span>
        <div class="entryOverview">The object context to use as "this" for the
    function.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            Whether f evaluates to true for at least one item in the
    LinkedMap.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_linkedmap.js.source.html#line353">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>






  <td>
    <a name="goog.structs.LinkedMap.prototype.truncate_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">truncate_<span class="args">(<span class="arg">count</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Removes elements from the LinkedMap if the given count has been exceeded.
In cache mode removes nodes from the tail of the list. Otherwise removes
nodes from the head.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">count</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">Number of elements to keep.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_linkedmap.js.source.html#line421">code &raquo;</a>
  </td>
     </tr>


  </table>
</div>
</div>




<h2>Instance Properties</h2>







<div>
       <div class="desc">
         Defined in
         <span class="fn-name">
            <a href="class_goog_structs_LinkedMap.html">
              goog.structs.LinkedMap
            </a>
         </span>
       </div>






<div class="section">
  <table class="horiz-rule">


     <tr class="even entry private">
       <td class="access"></td>





  <a name="goog.structs.LinkedMap.prototype.cache_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">cache_</span>
        : 
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_linkedmap.js.source.html#line76">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>





  <a name="goog.structs.LinkedMap.prototype.head_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">head_</span>
        : <span class="type"><a href="class_goog_structs_LinkedMap_Node_.html">goog.structs.LinkedMap.Node_</a></span>
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_linkedmap.js.source.html#line84">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>





  <a name="goog.structs.LinkedMap.prototype.map_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">map_</span>
        : <span class="type"><a href="class_goog_structs_Map.html">goog.structs.Map</a></span>
     </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_linkedmap.js.source.html#line82">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>





  <a name="goog.structs.LinkedMap.prototype.maxCount_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">maxCount_</span>
        : 
     </div>


     <div class="entryOverview">
       The maximum number of entries to allow, or null if there is no limit.

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_structs_linkedmap.js.source.html#line70">Code &raquo;</a>
  </td>
     </tr>


  </table>
</div>
</div>










<div class="section">
  <table class="horiz-rule">


  </table>
</div>









<div class="section">
  <table class="horiz-rule">


  </table>
</div>









<div class="section">
  <table class="horiz-rule">


  </table>
</div>
      <!-- Column 1 end -->
    </div>

        <div class="col2">
          <!-- Column 2 start -->
          <div class="col2-c">
            <h2 id="ref-head">Package structs</h2>
            <div id="localView"></div>
          </div>

          <div class="col2-c">
            <h2 id="ref-head">Package Reference</h2>
            <div id="sideTypeIndex" rootPath="" current="structs.LinkedMap"></div>
          </div>
          <!-- Column 2 end -->
        </div>
</div>
</div>

</body>
</html>
